<template>
  <div class="chart" />
</template>

<script>
import { merge } from 'lodash'
export default {
  name: 'EchartPie',
  props: {
    // 图标类型
    type: {
      type: String,
      default: 'pie'
    },
    // 业务数据
    dataList: {
      type: Array,
      default: () => []
    },
    // 特殊的样式定制
    extraOption: {
      type: Object,
      default: () => ({})
    },
    // 专项属性设置，各类型特有属性设置
    specialOption: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
      chart: null
    }
  },
  methods: {
    assembleDataToOption() {
      return merge(
        {},
        {
          series: [
            {
              name: '',
              type: this.type,
              data: this.dataList
            }
          ]
        },
        this.extraOption
      )
    }
  }
}
</script>

<style scoped>

</style>
